- /* srmststr.cpp by K.Tsuru */
- // function ID = 802 BRADIX
- /********************************************
- SRational class
- It sets a value by string in a decimal system.
- abcd...xyz/ABCD...XYZ type
- It counts first '/' only.
- *********************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- void SRational::SetString(const char *s){
- char* buff = new char[strlen(s)+1];
- int slash;
- char* pt = buff;
-
- while( (*s != '/') && *s ) *(pt++) = *(s++); //copy the numerator
- slash = (*s == '/') ? 1 : 0;
- *pt = '\0';
- //substitute into SLong objects by string
- SLong n, d;
- n = buff;
- if(slash == 0){ //no '/'
- d = 1.0;
- } else {
- s++; d = s;
- }
- Set(n, d); // includes radix conversion
- delete[] buff;
- }
srmststr.cpp : last modifiled at 2015/12/03 21:13:59(747 bytes)
created at 2016/06/26 15:57:35
The creation time of this html file is 2016/09/18 20:28:05 (Sun Sep 18 20:28:05 2016).